package com.jackson.framekafka.consumer;

/*
 * Author: JacksonCoder
 * FileName: UpdateUserConsumer
 * Version: 1.0.0
 * Date: 2025/4/18
 */

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@AllArgsConstructor
public class UpdateUserConsumer {

    public void receive(ConsumerRecord<?,?> consumer){
        log.info("主题" + consumer.topic() + "消费者接收" + consumer.value());
        try{
            String json = (String) consumer.value();
            System.out.println(json);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

}
